import request from '@/utils/request'

/**
 * 获取商品列表
 */
export function getGoodsList(params) {
  return new request({
    url: `/goodsmng${params}`,
    method: 'get'
  })
}

/**
 * 添加商品
 */
export function addGoodsList(data) {
  return new request({
    url: `/goodsmng`,
    method: 'post',
    data
  })
}

/**
 * 修改商品
 */
 export function updateGoodsList(data) {
  return new request({
    url: `/goodsmng/${data.id}`,
    method: 'put',
    data
  })
}

/**
 * 获取商品类型
 */
export function getGoodsTypes() {
  return new request({
    url: `/goodsTypes`,
    method: 'get'
  })
}

/**
 * 删除商品
 */
export function delGoods(id) {
  return new request({
    url: `/goodsmng/${id}`,
    method: 'delete'
  })
}

/**
 * 记录商品订单
 */
export function addGoodsOrder(data) {
  return new request({
    url: `/goodsOrder`,
    method: 'post',
    data
  })
}
